RealtimeComponent<TModel>
RealtimeComponent<TModel>
A component that synchronizes the state of a RealtimeModel to/from an object in the scene.
Events
event Action<RealtimeComponent<TModel>, int> ownerIDSelfDidChange
Dispatched when the ownerIDSelf value changes.
Properties
RealtimeView realtimeView { get; }
The RealtimeView that owns this component. Accessing this property before Start is unreliable.
Realtime realtime { get; }
The Realtime instance that is managing this component. On prefab views, this property is available after Awake. On scene views or their children, this is not available until Start.
Room room { get; }
The current room of the Realtime instance that is managing this component. This might be null if the Realtime instance hasn't connected yet. Accessing this property before Start is unreliable.
int ownerIDSelf { get; }
The client ID of the component owner.
int ownerIDInHierarchy { get; }
The client ID of the component's hierarchy owner (the root owner of the component).
bool isUnownedSelf { get; }
True if the component is not owned by any client.
bool isUnownedInHierarchy { get; }
True if the component and all of its parent views are not owned by any client.
bool isOwnedLocallySelf { get; }
True if the component is owned by the local client.
bool isOwnedLocallyInHierarchy { get; }
True if the component and all of its parent views are owned by the local client.
bool isOwnedRemotelySelf { get; }
True if the component is owned by a remote client.
bool isOwnedRemotelyInHierarchy { get; }
True if this component and all of its parent views are owned by a remote client.
Methods
void RequestOwnership()
Request ownership of the component.
void SetOwnership(int clientID)
Set ownership of the component.
void ClearOwnership()
Clear ownership of the component.